<?php
include "config.php";

$sql="select * from user order by id";
$rst=$mysqli->query($sql);
?>



<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>用户首页</title>
</head>
<body> 
<center>
    <h3>查看用户 | <a href="add.php">添加用户</a></h3>
    <hr>
    <table border='1' cellspacing='0' width='500px'>
        <tr>
            <th>ID</th>
            <th>用户名</th>
            <th>密码</th>
            <th>注册时间</th>
            <th>修改</th>
            <th>删除</th>
        </tr>
<?php
while($row=$rst->fetch_assoc()){
    echo "<tr>";
    echo "<td>{$row['id']}</td>";
    echo "<td>{$row['username']}</td>";
    echo "<td>{$row['password']}</td>";
    echo "<td>".date('Y-m-d H:i:s',$row['time'])."</td>";
    echo "<td><a href='edit.php?id={$row['id']}'>编辑</a></td>";
    echo "<td><a href='delete.php?id={$row['id']}'>删除</a></td>";
    echo "</tr>";
}
?>

    </table>
</center>   
    
</body>
</html>